from ssh_client import SSHClient


def reset(pin):
    # 配置SSH连接参数
    hostname = '192.168.101.104'
    port = 22
    username = 'chenxi'
    password = 'cx123456'

    # 创建SSH客户端实例
    ssh_client = SSHClient(hostname, port, username, password)

    try:
        # 建立连接
        ssh_client.connect()

        # 执行命令
        command = f'python3 /home/chenxi/gpio_control.py {pin}'
        ssh_client.execute_command(command)
    finally:
        # 关闭连接
        ssh_client.close()


if __name__ == '__main__':
    reset(24)